import { getFormData, uploadImageFile, updateCarousel } from '../services';

export default {
  namespace: 'settingsModel',
  state: {
  },
  effects: {
    *getFormData({ payload }, { put, call, select }) {
      return yield call(getFormData, payload);
    },
    *uploadImageFile({ payload }, { put, call, select }) {
      return yield call(uploadImageFile, payload);
    },
    *updateCarousel({ payload }, { put, call, select }) {
      return yield call(updateCarousel, payload);
    },
  },
  reducers: {
    /* 更新状态（通用） */
    updateModel: (state, { payload }) => ({
      ...state,
      ...payload,
    }),
  },
};
